package com.suray.attendance.db;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateParsingAndTimestampExample {
    public  void main(String[] args) {
        String dateString = "2023-10-08T10:41Z";
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'");
        
        try {
            Date date = dateFormat.parse(dateString);
            long timestamp = date.getTime(); // 获取时间戳
            System.out.println("Parsed date: " + date);
            System.out.println("Timestamp: " + timestamp);
        } catch (ParseException e) {
            e.printStackTrace();
        }
    }
}
